import request from "@/utils/axios/request";
import { ExamPaper } from "../addExamPaper";

interface GetPaperListParams {
  pageNum: number;
  pageSize: number;
  name: string;
}

const getPaperList = ({  pageNum, pageSize, name }: GetPaperListParams) => {
  return request.get(
    `/exam/getTestPaper?pageNum=${pageNum}&pageSize=${pageSize}&name=${name}`
  );
};
const getPaper = (id:string) => {
  return request.get(
    `/exam/getTestPaper?id=${id}`
  );
};
export const addTestPaper = (data: ExamPaper) => {
  return request.post("/exam/addTestPaper", data);
};

const delTestPaper = (ids: any) => {
  return request.post("/exam/delTestPaper", ids);
};

const updateTestPaper = (data: ExamPaper) => {
  return request.post("/exam/updateTestPaper", data);
};

const examApi = {
  getPaperList,
  addTestPaper,
  delTestPaper,
  updateTestPaper,
  getPaper
};

export default examApi
